#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "LitePlayer.h"
#include "MediaProp.h"
#include "MediaEvent.h"


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow,
        public av::MediaEventSink,
        public av::MediaPacketSink
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    QString getMediaUrl();


protected:
    virtual void onMediaEvent(av::LitePlayer* player, int type, int64_t value);

    virtual void onMediaFormat(const av::MediaFormat& format);
    virtual void onMediaPacket(MediaPacket& packet);
    virtual void onMediaEnd();

signals:
    void mediaEvent(int type);


private slots:
    void on_pushButtonPlay_clicked();

    void on_pushButtonPause_clicked();

    void on_pushButtonStop_clicked();

    void on_pushButtonFull_clicked();

    void on_pushButtonMute_clicked();

    void on_pushButtonRecord_clicked();

    void onPlayerMediaEvent(int type);

    void on_pushButtonSlow_clicked();

    void on_pushButtonFast_clicked();

    void on_pushButtonKeyFrame_clicked();

    void on_pushButtonStep_clicked();

    void on_horizontalSlider_sliderReleased();

private:
    QString makeRecordName();

private:
    Ui::MainWindow *ui;



private:
    av::LitePlayer* m_player;

};

#endif // MAINWINDOW_H
